import { createApp } from 'vue';
import '@/assets/styles/index.scss';
import i18n from './i18n/index';
import router from './router';
import { createPinia } from 'pinia';
import App from './App.vue';

const pinia = createPinia();

const app = createApp(App);
app.config.errorHandler = (err, _vm) => {
	console.error('捕获到 组件渲染过程 和 生命周期中的错误：', err);
};
window.onunhandledrejection = (event) => {
	console.error('未捕获的 Promise 异常:', event.reason);
};
window.addEventListener('error', (event) => console.error('全局捕获到错误:', event.error));

app.use(pinia);
app.use(router);
app.use(i18n);
app.mount('#app');
